﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExtJSExtender.Controls
{
    #region 树节点事件的参数

    public class TreeNodeEventArgs : EventArgs
    {
        /// <summary>
        /// 获取或设置触发事件的节点
        /// </summary>
        public string NodeId { get; set; }
    }

    #endregion

    #region NodeClickEventHandler

    /// <summary>
    /// 节点单击事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void NodeClickEventHandler(Object sender, TreeNodeEventArgs e);

    #endregion

    #region NodeSelectChangedEventHandler

    public class TreeNodeSelectChangedEventArgs : TreeNodeEventArgs
    {
        public string OldSelectedId { get; set; }
        public string OldSelectedPath { get; set; }
        public string SelectedId { get; set; }
        public string SelectedPath { get; set; }
    }
    /// <summary>
    /// 选择改变的事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void NodeSelectChangedEventHandler(object sender, TreeNodeSelectChangedEventArgs e);

    #endregion

    #region NodeCheckChangedEventHandler

    public class TreeNodeCheckChangedEventArgs : TreeNodeEventArgs
    {
        public bool IsChecked { get; set; }
    }
    /// <summary>
    /// 勾选改变事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void NodeCheckChangedEventHandler(object sender, TreeNodeCheckChangedEventArgs e);

    #endregion

    #region NodeExpandChangedEventHandler

    /// <summary>
    /// 展开事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void NodeExpandChangedEventHandler(object sender, TreeNodeEventArgs e);

    #endregion

    #region NodeCollapseChangedEventHandler

    /// <summary>
    /// 折叠事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void NodeCollapseChangedEventHandler(object sender, TreeNodeEventArgs e);

    #endregion

    #region LoadChildrenChangedEventHandler

    public class LoadChildrenEventArgs : TreeNodeEventArgs
    {
        public TreeNode Node { get; set; }
    }

    /// <summary>
    /// 加载子节点事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void LoadChildrenEventHandler(object sender, LoadChildrenEventArgs e);

    #endregion
}
